package com.sg.dto.integration.app;

import com.sg.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;

/**
 * @desc ConfSchemeItemResultDto
 * @使用场景
 */
@Data
public class ConfSchemeItemResultDto extends BaseDto implements Serializable {

    /**
     * 配置方案ID:
     */
    @ApiModelProperty("配置方案ID ")
    private String confSchemeId;

    /**
     * 结果值:
     */
    @ApiModelProperty("结果值")
    private String endValue;

    /**
     * 配置项标识:
     */
    @ApiModelProperty("配置项标识")
    private String confItemCode;

    /**
     * 答案ID
     */
    @NotNull(message = "答案ID不能为空")
    @ApiModelProperty("答案ID")
    private String optionResultId;

    /**
     * 答案排序
     */
    @NotNull(message = "答案排序不能为空")
    @ApiModelProperty("答案排序")
    private Long confOptionSortNum;

    /**
     * 选项标识
     */
    @ApiModelProperty("选项标识")
    private String confOptionCode;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        ConfSchemeItemResultDto that = (ConfSchemeItemResultDto) o;
        return (
                confSchemeId == that.confSchemeId &&
                        endValue == that.endValue &&
                        confItemCode == that.confItemCode &&
                        optionResultId == that.optionResultId &&
                        confOptionSortNum == that.confOptionSortNum &&
                        confOptionCode == that.confOptionCode
        );
    }

    @Override
    public int hashCode() {
        return Objects.hash(
                super.hashCode(),
                confSchemeId,
                endValue,
                confItemCode,
                optionResultId,
                confOptionSortNum,
                confOptionCode
        );
    }
}
